package day004;

public class Methodtest04 {
    public static void main(String[] args) {
//        boolean flag = isFlower(111);
//        System.out.println("163是水仙花数：" + flag);
        for (int i = 1; i < 999; i++) {
            if (isFlower(i)) {
                System.out.println(i);
            }
        }
    }

    public static boolean isFlower(int num) {
        int ge = num % 10;
        int shi = num / 10 % 10;
        int bai = num / 100 % 10;

        if (ge * ge * ge + shi * shi * shi + bai * bai * bai == num) {
            return true;
        } else {
            return false;
        }
    }
}
